package com.example.demo.Test;

import java.awt.*;

public class test {
    public static void main(String[] args) {
        try {
            for (int i = 0; i < 100; i++) {
                Robot robot = new Robot();
                Color pixelColor = robot.getPixelColor(200+i, 200+i);
                int rgb = pixelColor.getRGB();
               /* robot.mouseMove(200,200);
                robot.delay(200);
                robot.mousePress(KeyEvent.BUTTON1_MASK);
                robot.delay(20);
                robot.mouseRelease(KeyEvent.BUTTON1_MASK);*/
                //robot.delay(1);
                System.out.println("颜色:"+rgb);
            }

        } catch (AWTException e) {
            e.printStackTrace();
        }


    }
}
